<ion-header>
  <ion-navbar>
    <ion-title>用户信息</ion-title>
    <ion-buttons end>
      <button (click)="presentPopover($event)">
        <ion-icon name="more"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content padding class="user-detail" style="padding:0px;">

  <ion-card class="custom-padding" style="margin: 0px;padding:0px;width:100%;">

    <ion-card-content class="custom-padding" style="padding:0px;">
      <form class="list" class="custom-padding">
        <ion-item class="small">
          <ion-label style="color:#000000;">用户名：</ion-label>
          <ion-input type="text" [(ngModel)]="user.name" #name="ngModel" name="name" required></ion-input>
        </ion-item>

        <ion-item class="small">
          <ion-label>启用帐号</ion-label>
          <ion-toggle #isAccountEnabled="ngModel" [(ngModel)]="user.enabled" name="isAccountEnabled"></ion-toggle>
        </ion-item>

        <ion-item class="small" style="min-height: 3rem;">
          <ion-label style="color:#000000;">帐号：</ion-label>
          <ion-input type="text" [(ngModel)]="user.account" #account="ngModel" name="account" required
                     placeholder="请输入帐号" style="min-height: 3rem;"></ion-input>
        </ion-item>

        <ion-item class="small">
          <ion-label style="color:#000000;">密码：</ion-label>
          <ion-input type="password" [(ngModel)]="user.password" #password="ngModel" name="password" required
                     placeholder="请输入密码"></ion-input>
        </ion-item>

        <ion-item>
          <ion-label style="color:#000000;">权限</ion-label>
          <ion-select [(ngModel)]="user.role" #role="ngModel" name="role">
            <ion-option value="view">查看</ion-option>
            <ion-option value="modify">修改</ion-option>
            <ion-option value="admin">管理员</ion-option>
          </ion-select>
        </ion-item>

      </form>

    </ion-card-content>

  </ion-card>
  <button id="saveButton" class="button button-positive  button-block"
          (click)="onSaveUser()">保存
  </button>

</ion-content>
